package rj.servlet;

import javax.servlet.GenericServlet;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.annotation.WebServlet;
import java.io.IOException;
import java.io.PrintWriter;

import static java.lang.System.out;

@WebServlet(name = "ShowInformation" , urlPatterns = "/ShowInformation")
public class ShowInformation extends GenericServlet {
    @Override
    public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html;charset=utf-8");
        PrintWriter out = response.getWriter();
        String name = "xxx";
        String major = "软件工程";
        String classid = "2班";
        String id = "202203020239";
        String gender = "男";
        String age = "20";
//        String name = "xxx";
//        String major = "软件工程";
//        String classid = "2班";
//        String id = "202203020239";
//        String gender = "男";
//        String age = "20";

        out.println("<html><body>");
        out.println("<p>" + "专业：" + major + "</p>");
        out.println("<p>" + "班级：" + classid + "</p>");
        out.println("<p>" + "学号：" + id + "</p>");
        out.println("<p>" + "姓名：" + name + "</p>");
        out.println("<p>" + "性别：" + gender + "</p>");
        out.println("<p>" + "年龄：" + age + "</p>");
        out.println("<p>专业：软件工程</p>");
        out.println("<p>班级：2班</p>");
        out.println("<p>学号：202203020239</p>");
        out.println("<p>姓名：xxx</p>");
        out.println("<p>性别：男</p>");
        out.println("<p>年龄：20</p>");

        out.println("</body></html>");
    }
}